package com.bajayk.placeme.view 
{
	import Box2D.Collision.b2AABB;
	import Box2D.Dynamics.b2Body;
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	/**
	 * ...
	 * @author Ajay Badgujar
	 */
	public class Actor 
	{
		private var _body:b2Body;
		private var _costume:DisplayObject;
		
		public function Actor(myBody:b2Body, myCostume:DisplayObject) 
		{
			_body = myBody;
			_costume = myCostume;
			
			updateMyLook();
		}
		
		public function updateNow():void {
			if( !_body.IsStatic){
				updateMyLook();
			}
			childSpecificUpdating();
		}
		
		protected function childSpecificUpdating():void 
		{
			
		}
		
		private function updateMyLook():void 
		{
			_costume.x = _body.GetPosition().x * World.RATIO;
			_costume.y = _body.GetPosition().y * World.RATIO;
			_costume.rotation = _body.GetAngle() * 180 / Math.PI;
		}
		
	}

}